{% extends "base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}
{% block content %}

    <h1>Register</h1>
    <form action="{{ url_for_security('register') }}" method="POST" name="register_user_form">
      {{ register_user_form.hidden_tag() }}
      {{ register_user_form.csrf_token }}
      {{ wtf.form_errors(register_user_form, hiddens="only") }}

      {{ wtf.form_field(register_user_form.name) }}
      {{ wtf.form_field(register_user_form.title) }}
      {{ wtf.form_field(register_user_form.email) }}

      {% if register_user_form.email.errors %}
        If your email account already exists, you may need to <a class="btn btn-primary" href="{{ url_for_security('send_confirmation') }}">Confirm your account</a> first.
      {% endif %}

      {{ wtf.form_field(register_user_form.password) }}

      {% if register_user_form.password_confirm %}
        {{ wtf.form_field(register_user_form.password_confirm) }}
      {% endif %}
      <div class="controls">
          {{ wtf.form_field(register_user_form.submit) }}
      </div>
    </form>

    {% include "security/_menu.html" %}
{% endblock %}
